#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
@File Name: 集合实现的性能比较_settimetest.py
@Author: LT
@Date: 2021/9/27 19:18
# -----------------------------------------------------------------------------------------------------
@Description: 
运行命令的方式如：
python 集合实现的性能比较_settimetest.py 200
# -----------------------------------------------------------------------------------------------------
"""
import sys
import 优化_使用字典类型实现集合_fastset as fastset
import 简单的测时工具_timer as timer
import 普通集合类_set as set


def setops(Class):
    a = Class(range(50))
    b = Class(range(20))
    c = Class(range(10))
    d = Class(range(5))
    for i in range(5):
        t = a & b & c & d   # 取交集
        t = a | b | c | d   # 取并集


if __name__ == '__main__':
    rept = int(sys.argv[1])
    print("set=>", timer.test(rept, setops, set.Set))
    print("fastset=>", timer.test(rept, setops, fastset.Set))
    pass
